package hoowin.app.wsnd.action;

import hoowin.app.wsnd.service.DiscussionService;
import hoowin.basic.model.User;

import com.opensymphony.xwork2.ActionSupport;

@SuppressWarnings("serial")
public class AddDiscussion extends ActionSupport {
	private String content;
	private int toUserId;
	private int statusId;
	private User user;
	private DiscussionService discussionService;
	
	public String execute(){
		if(content==null || content.length()==0|| user.getId()==0);
		else{
			discussionService.addDiscussion(content, statusId, user.getId(), toUserId);
		}
		return SUCCESS;
	}
	
	public void setContent(String content) {
		this.content = content;
	}

	public String getContent() {
		return content;
	}

	public void setToUserId(int toUserId) {
		this.toUserId = toUserId;
	}

	public int getToUserId() {
		return toUserId;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public User getUser() {
		return user;
	}

	public void setDiscussionService(DiscussionService discussionService) {
		this.discussionService = discussionService;
	}

	public DiscussionService getDiscussionService() {
		return discussionService;
	}

	public void setStatusId(int statusId) {
		this.statusId = statusId;
	}

	public int getStatusId() {
		return statusId;
	}
}
